import router from "./router";
import store from "./store";
const whiteList= ['/login','/404']

router.beforeEach((to, from, next) => {
  const token = store.getters.token
  if(token){
    next()
  }else{
    if(whiteList.includes(to.path)){
      next()
    }else{
      next('/login')
    }
  }
})